package larpplanner.logic;

import java.util.List;

import larpplanner.database.CharUniverse;
import larpplanner.database.DBHandler;
import larpplanner.database.Player;
import larpplanner.database.Quest;

/*
 * Common interface shared both by the GUI and logic
 */
public interface LARPManager {
    
    /* DB directly related */
    <T> T       get(Class<T> cls, long id);
    <T> List<T> getAll(Class<T> cls);
    <T> Long    add(Class<T> cls, T obj);
    <T> boolean del(Class<T> cls, long id);
    boolean		deleteAll();
    <T> boolean update(Class<T> cls, T obj);
    
    
    /* Helper functions */
    List<QuestSummary>  getQuests();
    Long                signIn(String email, String password);
    boolean             signUp(Player player);
    List<CharUniverse>  getCharacters(String universe_name);
    QuestSummary        summaryFromQuest(Quest quest);
    Long				addParticipant(long questID , long playerID , long characterID);
    boolean				removeParticipant(long questID , long playerID);
    boolean				updateDBfromFreebase();
    
    
    /* tmp */
    DBHandler           getDBHandler();
}
